﻿<cfsilent>
	<cfscript>
	
		propertyAdvice = getProperty("serviceFactory").getBean("studentPropertyAdvice");

		event.setArg("pageTitle", "大学外语等级考试 - 打印在读证明");
		
		currentTab = event.getArg("TabID", "labSearch");
		
		targetArgs = structNew();
		passArgs = structNew();
		
		/* 搜索学生档案 */
		keyword = event.getArg("Keywords");
		
		rs_student = queryNew("stu_id, stu_name, cls_name, student_prop");
		
		if ( len(keyword) ) {
			
			sql = "SELECT DISTINCT 
					t_student.stu_id, t_student.stu_name, 
					t_class.cls_name, 
					t_student_status.student_prop 
					FROM t_cet_scroll 
					INNER JOIN t_student ON t_student.stu_id = t_cet_scroll.stu_id 
					INNER JOIN t_student_status ON t_student.stu_id = t_student_status.stu_id 
					INNER JOIN t_class ON t_class.cls_id = t_student.cls_id 
					WHERE 
						t_student.stu_id LIKE :condition 
						OR 
						t_student.stu_name LIKE :condition 
					ORDER BY 
						t_student.stu_name ";
			
			queryObj = new Query( datasource=application.dnsSlave, maxRows=12 );
			queryObj.addParam( name="condition", value=keyword&"%", cfsqltype="cf_sql_varchar" );

			rs_student = queryObj.execute( sql=sql ).getResult();
			
		}

	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('DEFAULT_EVENT')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">大学外语等级考试</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 application"></i>打印学生成绩证明
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labSearch">class="active"</cfif> id="labSearch" tabTarget="Search">搜索学生</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="Search" class="tabContent">
					
					<form id="formSearch" onSubmit="javascript:return processVerfiyForm('formSearch');" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('cetPrint')#</cfoutput>">
						<input type="hidden" name="TabID" value="labSearch" />
						
						<div class="label">
							<b>学号或姓名</b>
							<input name="Keywords" id="Keywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#event.getArg('Keywords')#</cfoutput>" />
						</div>
						<hr/>
						<div class="lable">
							<input class="button1" type="submit" value="搜索" />
						</div>
					</form>
					
					<cfif rs_student.recordCount>

						<div class="clearfix">
							
							<cfloop query="rs_student">
								
								<cfset structInsert( passArgs, "STU", rs_student.stu_id, true ) />
								<cfset propertyAdvice.parseProperty( rs_student.student_prop ) />
									
								<div class="UISmallUserCard">
									<div class="cardContent <cfif not propertyAdvice.getInSchool()>disabled</cfif>">
										<a href="<cfoutput>#buildURL('cetStudentScroll', passArgs)#</cfoutput>"><img class="img" src="<cfoutput>#getProperty('cdnServer')#</cfoutput><cfoutput>#getContextRoot()#</cfoutput>/acadmicRes/assets/graphic/userSmall.png" style="background-image: url('<cfoutput>#getContextRoot()#</cfoutput>/acadmicManager/student/portrait/<cfoutput>#rs_student.stu_id#</cfoutput>.jpg');"></a>
										<div class="cardDetail">
											<h3><a href="<cfoutput>#buildURL('cetStudentScroll', passArgs)#</cfoutput>"><cfoutput>#rs_student.stu_name#</cfoutput></a> (<cfoutput>#rs_student.stu_id#</cfoutput>)</h3>
											<p><cfoutput>#rs_student.cls_name#</cfoutput></p>
										</div>
									</div>
								</div>
								
							</cfloop>

						</div>
						<cfelse>
						<cfif len(keyword)>
							<div class="systemNotice">
								<h3>没有搜索到该学生的成绩记录</h3>
							</div>
						</cfif>
					</cfif>
					
				</div>

			</div>
		</li>
	</ul>
</div>



